package com.example.weight.navigation;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.example.weight.R;
import com.example.weight.greenSeasons.compost.RoleSelectActivity;
import com.example.weight.greenSeasons.flocculation.*;
import com.example.weight.householdWaste.ChoseRoleActivity;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;
import android.net.Uri;

public class SijiqingFlocculationNavActivity extends AppCompatActivity {
    private TitleBar titleBar;
    String name, factory;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sijiqing_flocculation_nav);
        Intent previousIntent = getIntent();
        name = previousIntent.getStringExtra("name");
        factory = previousIntent.getStringExtra("factory");
        titleBar=findViewById(R.id.titleBar);
        titleBar.setOnTitleBarListener(new OnTitleBarListener() {

            @Override
            public void onLeftClick(View v) {
                SijiqingFlocculationNavActivity.this.finish();
            }

            @Override
            public void onTitleClick(View v) {

            }

            @Override
            public void onRightClick(View v) {

            }


        });
    }

    public void turnEle(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, xuningyongdian.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }

    public void turnFacCheck(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, ChoseRoleActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("fName", "xuningshebeijiancha_old");
        startActivity(intent);
    }

    public void turnDay(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, xuningRoleSelectActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("type", "daily_old");
        startActivity(intent);
    }
    public void turnWeek(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, xuningRoleSelectActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("type", "week");
        startActivity(intent);
    }
    public void turnMonth(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, xuningRoleSelectActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("type", "month");
        startActivity(intent);
    }

    public void turnFault(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, xuningguzhang.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }

    public void turnCraft(View view) {
        Intent intent =new Intent(SijiqingFlocculationNavActivity.this, xuninggongyi_old.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }

    public void turnBrowser(View view){
        Uri uri = Uri.parse("http://39.105.29.195/#/login");
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        startActivity(intent);
    }
}
